package com.dh.calendar;

public class InstanceDemo01 {

    Animal animal = Animal.getInstance();
}


abstract class Animal {

    public static Animal getInstance() {
        return new Dog();
    }
}

class Dog extends Animal {

}
